package com.example.designpatterns.state;

/**
 * ShippedState类 - 已发货状态
 * 
 * 实现与已发货状态相关的行为
 */
public class ShippedState implements State {
    @Override
    public void pay(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已支付，请勿重复支付");
    }
    
    @Override
    public void ship(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已发货，请勿重复操作");
    }
    
    @Override
    public void receive(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已确认收货，交易完成");
        context.setState(new CompletedState());
    }
    
    @Override
    public void refund(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已申请退款，等待处理");
        context.setState(new RefundState());
    }
    
    @Override
    public void cancel(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已发货，无法取消，请申请退款");
    }
    
    @Override
    public String getDescription() {
        return "已发货";
    }
} 